from app import db
from views import user_datastore
from werkzeug.security import generate_password_hash
# 权限初始化文件
# 初始化超级管理员账号
password = generate_password_hash('123456')
admin = user_datastore.create_user(userID=2017151404, phone=15029538668, email='1044607376@qq.com', password=password)
# 生成普通用户角色和admin用户角色
user_datastore.create_role(name='User', description='Generic user role')
admin_role = user_datastore.create_role(name='Admin', description='Admin user role')
Root_role = user_datastore.create_role(name='Root', description='Root user role')
# 为admin添加Admin角色
user_datastore.add_role_to_user(admin, Root_role)


db.session.commit()


# INSERT INTO `nation` VALUES ('1', '基诺族');
# INSERT INTO `nation` VALUES ('2', '珞巴族');
# INSERT INTO `nation` VALUES ('3', '门巴族');
# INSERT INTO `nation` VALUES ('4', '赫哲族');
# INSERT INTO `nation` VALUES ('5', '鄂伦春族');
# INSERT INTO `nation` VALUES ('6', '独龙族');
# INSERT INTO `nation` VALUES ('7', '塔塔尔族');
# INSERT INTO `nation` VALUES ('8', '京族');
# INSERT INTO `nation` VALUES ('9', '裕固族');
# INSERT INTO `nation` VALUES ('10', '保安族');
# INSERT INTO `nation` VALUES ('11', '德昂族');
# INSERT INTO `nation` VALUES ('12', '鄂温克族');
# INSERT INTO `nation` VALUES ('13', '俄罗斯族');
# INSERT INTO `nation` VALUES ('14', '乌孜别克族');
# INSERT INTO `nation` VALUES ('15', '怒族');
# INSERT INTO `nation` VALUES ('16', '塔吉克族');
# INSERT INTO `nation` VALUES ('17', '普米族');
# INSERT INTO `nation` VALUES ('18', '阿昌族');
# INSERT INTO `nation` VALUES ('19', '锡伯族');
# INSERT INTO `nation` VALUES ('20', '仡佬族');
# INSERT INTO `nation` VALUES ('21', '毛南族');
# INSERT INTO `nation` VALUES ('22', '撒拉族');
# INSERT INTO `nation` VALUES ('23', '布朗族');
# INSERT INTO `nation` VALUES ('24', '羌族');
# INSERT INTO `nation` VALUES ('25', '仫佬族');
# INSERT INTO `nation` VALUES ('26', '达斡尔族');
# INSERT INTO `nation` VALUES ('27', '土族');
# INSERT INTO `nation` VALUES ('28', '柯尔克孜族');
# INSERT INTO `nation` VALUES ('29', '景颇族');
# INSERT INTO `nation` VALUES ('30', '纳西族');
# INSERT INTO `nation` VALUES ('31', '东乡族');
# INSERT INTO `nation` VALUES ('32', '水族');
# INSERT INTO `nation` VALUES ('33', '拉祜族');
# INSERT INTO `nation` VALUES ('34', '高山族');
# INSERT INTO `nation` VALUES ('35', '畲族');
# INSERT INTO `nation` VALUES ('36', '佤族');
# INSERT INTO `nation` VALUES ('37', '僳僳族');
# INSERT INTO `nation` VALUES ('38', '黎族');
# INSERT INTO `nation` VALUES ('39', '傣族');
# INSERT INTO `nation` VALUES ('40', '哈萨克族');
# INSERT INTO `nation` VALUES ('41', '哈尼族');
# INSERT INTO `nation` VALUES ('42', '土家族');
# INSERT INTO `nation` VALUES ('43', '白族');
# INSERT INTO `nation` VALUES ('44', '瑶族');
# INSERT INTO `nation` VALUES ('45', '侗族');
# INSERT INTO `nation` VALUES ('46', '满族');
# INSERT INTO `nation` VALUES ('47', '朝鲜族');
# INSERT INTO `nation` VALUES ('48', '布依族');
# INSERT INTO `nation` VALUES ('49', '壮族');
# INSERT INTO `nation` VALUES ('50', '彝族');
# INSERT INTO `nation` VALUES ('51', '苗族');
# INSERT INTO `nation` VALUES ('52', '维吾尔族');
# INSERT INTO `nation` VALUES ('53', '藏族');
# INSERT INTO `nation` VALUES ('54', '回族');
# INSERT INTO `nation` VALUES ('55', '蒙古族');
# INSERT INTO `nation` VALUES ('56', '汉族');
